package com.bbx.taxi.client.Activity.Menu;

import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnLongClickListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.InjectView;

import com.bbx.api.sdk.Config;
import com.bbx.api.sdk.net.base.HttpComm;
import com.bbx.taxi.official.R;
import com.bbx.taxi.client.Activity.Base.BaseBBXActivity;
import com.bbx.taxi.client.Bean.Value;
import com.bbx.taxi.client.Bean.Extra.SetMsg;
import com.bbx.taxi.client.Util.ChannelName;
import com.bbx.taxi.client.Util.VersionInfo;
import com.bbx.taxi.client.widget.Dailog.MyAlertDailog;
import com.bbx.taxi.client.widget.Dailog.MyAlertDailog.onClickSingleListener;

public class AboutActivity extends BaseBBXActivity {
	@InjectView(R.id.tv_version)TextView tv_version;
	@InjectView(R.id.iv_pubiao)ImageView iv_pubiao;
    @InjectView(R.id.tv_telkf)TextView tv_telkf;
	protected void onCreate(Bundle savedInstanceState) {

		setContentView(R.layout.acticity_about);
		super.onCreate(savedInstanceState);
	
	}

	@Override
	protected void initView() {	
		setTitle("帮邦行介绍");
		tv_telkf.setText(Value.TEL_KF);
		tv_version.setText("版本:"+VersionInfo.getVersion(this));
		/////////////////////////////
		iv_pubiao.setOnLongClickListener(new OnLongClickListener() {
			@Override
			public boolean onLongClick(View v) {
				final MyAlertDailog dialog = new MyAlertDailog(AboutActivity.this);
				String huanjing = "";
				switch(Config.getInstance().Env){
				case 3:
					huanjing="环境：开发";
					break;
				case 4:
					huanjing="环境：测试";
					break;
				case 5:
					huanjing="环境：正式";
					break;
				}
				dialog.setTitle(huanjing);
//				dialog.setContent(huanjing+"\n域名："+HttpComm.BASE_URL+"\n"+"TCP IP:"+Config.IP+"\nTCP端口："+Config.PORT+"\n渠道编号："+ChannelName.getAppMetaData(AboutActivity.this));
				dialog.setContent(huanjing+"\n渠道编号："+ChannelName.getAppMetaData(AboutActivity.this));
				dialog.setSingle("知道了");
				dialog.show();
				dialog.setOnClickSingleListener(new onClickSingleListener() {
					@Override
					public void onClickSingle() {
						dialog.dismiss();
					}
				});
				return false;
			}
		});
	}

	@Override
	protected void initData() {
		// TODO Auto-generated method stub

	}
	@Override
	public void onClick(View v) {
		switch(v.getId()){
		 default:
				super.onClick(v);
			 break;
		}

	}
	
}
